home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
0574.ZIP
/
STRCPY.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-11-21
|
598b
|
42 lines
include compiler.inc
ttl STRCPY, 1.04, 08-30-86, clr
;string function - copies strg2 over strg1
;
; - copies strg2 over strg1 at most n characters
; NOTE: If strg2 has more than cnt characters, the result
; will NOT be null terminated!!
dseg
cseg
procdef strncpy, <<strg1, ptr>, <strg2, ptr>, <cnt,word>>
mov cx,cnt
jmp short start
entrdef strcpy
mov cx,7fffh
start:
pushreg
pushds
jcxz endit
ldptr di,strg1
ldptr si,strg2
cld
lp:
lodsb
stosb
or al,al
jz endit
loop lp
endit:
clc
retptrm strg1
pend strncpy
finish
end